<template>
    <div class="SongList">
        <ul class="song-list" >
        <li class="item" v-for="value in songs" :key="value.tem" @click="selecMusic(value.id)">
            <!-- <img :src="value.song.album.picUrl" alt=""> -->
            <img v-lazy="value.picUrl" alt="">
            <div>
            <h3>{{value.name}}</h3>
            <p>{{value.name}}</p>
            </div>
        </li>
        </ul>
    </div>
</template>
<script>
import {mapActions} from 'vuex'
export default {
    name:'SongListItem',
    props:{
        songs:{
        type:Array,
        default:()=>[],
        required:true
        }
    },
    methods:{
    ...mapActions([
        'setFullScreen',
        'setSongDetail'
    ]),
    //点击音乐时 
    selecMusic(id){
      this.setFullScreen(true);//打开播放列表
      this.setSongDetail([id]);//获取歌曲详情
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../assets/css/mixin";
@import "../assets/css/variable";

  .song-list{
    width: 100%;
    @include bg_sub_color();
    .item{
      height: 200px;
      width: 100%;
      border-bottom:1px solid #fff;
      padding: 0 20px;
      display: flex;
      align-items: center;
      img{
        width: 150px;
        height: 150px;
        border-radius: 20px;
        margin-right: 20px;
      }
      h3{
        @include font_color();
        @include font_size($font_large);
      }
      p{
        @include font_color();
        @include font_size($font_samll);
        margin-top: 20px;
        opacity: 0.6;
      }
    }
  }
</style>